package com.gzc.just.play.last.war.robotclient;

import java.io.Serializable;
import java.util.Objects;

/**
 * 机器人客户端配置
 * 基于C++配置结构实现
 */
public class RobotClientConfig implements Serializable {
    private static final long serialVersionUID = 1L;
    
    // 基本配置
    private long robotId;
    private String username;
    private String password;
    private String nickname;
    private int sex = 1;
    private int headerId = 1;
    private int platformId = 0;
    
    // 服务器配置
    private String loginServerHost = "127.0.0.1";
    private int loginServerPort = 30001;
    private String gateServerHost = "127.0.0.1";
    private int gateServerPort = 40001;
    
    // AI配置
    private boolean enableAI = true;
    private int aiType = 1; // 1-简单AI, 2-高级AI
    
    public RobotClientConfig() {
    }
    
    public RobotClientConfig(long robotId, String username, String password, String nickname) {
        this.robotId = robotId;
        this.username = username;
        this.password = password;
        this.nickname = nickname;
    }
    
    // Getters and Setters
    public long getRobotId() {
        return robotId;
    }
    
    public void setRobotId(long robotId) {
        this.robotId = robotId;
    }
    
    public String getUsername() {
        return username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public String getNickname() {
        return nickname;
    }
    
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }
    
    public int getSex() {
        return sex;
    }
    
    public void setSex(int sex) {
        this.sex = sex;
    }
    
    public int getHeaderId() {
        return headerId;
    }
    
    public void setHeaderId(int headerId) {
        this.headerId = headerId;
    }
    
    public int getPlatformId() {
        return platformId;
    }
    
    public void setPlatformId(int platformId) {
        this.platformId = platformId;
    }
    
    public String getLoginServerHost() {
        return loginServerHost;
    }
    
    public void setLoginServerHost(String loginServerHost) {
        this.loginServerHost = loginServerHost;
    }
    
    public int getLoginServerPort() {
        return loginServerPort;
    }
    
    public void setLoginServerPort(int loginServerPort) {
        this.loginServerPort = loginServerPort;
    }
    
    public String getGateServerHost() {
        return gateServerHost;
    }
    
    public void setGateServerHost(String gateServerHost) {
        this.gateServerHost = gateServerHost;
    }
    
    public int getGateServerPort() {
        return gateServerPort;
    }
    
    public void setGateServerPort(int gateServerPort) {
        this.gateServerPort = gateServerPort;
    }
    
    public boolean isEnableAI() {
        return enableAI;
    }
    
    public void setEnableAI(boolean enableAI) {
        this.enableAI = enableAI;
    }
    
    public int getAiType() {
        return aiType;
    }
    
    public void setAiType(int aiType) {
        this.aiType = aiType;
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RobotClientConfig that = (RobotClientConfig) o;
        return robotId == that.robotId &&
                Objects.equals(username, that.username) &&
                Objects.equals(password, that.password);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(robotId, username, password);
    }
    
    @Override
    public String toString() {
        return "RobotClientConfig{" +
                "robotId=" + robotId +
                ", username='" + username + '\'' +
                ", nickname='" + nickname + '\'' +
                ", sex=" + sex +
                ", headerId=" + headerId +
                ", platformId='" + platformId + '\'' +
                ", loginServerHost='" + loginServerHost + '\'' +
                ", loginServerPort=" + loginServerPort +
                ", gateServerHost='" + gateServerHost + '\'' +
                ", gateServerPort=" + gateServerPort +
                ", enableAI=" + enableAI +
                ", aiType=" + aiType +
                '}';
    }
}